//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    public class ConnectorNonVisual : IOfficeXmlSerializable
    {
        private NonVisualConnectorProperties cNvCxnSpPr;
        private NonVisualDrawingProperties cNvPr;

        public NonVisualDrawingProperties NonVisualDrawingProperties
        {
            get { return cNvPr; }
            set { cNvPr = value; }
        }

        public NonVisualConnectorProperties NonVisualConnectorProperties
        {
            get { return cNvCxnSpPr; }
            set { cNvCxnSpPr = value; }
        }

        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (var c = context.Read("nvCxnSpPr"))
            {
                NonVisualDrawingProperties = c.ReadElement<NonVisualDrawingProperties>();
                NonVisualConnectorProperties = c.ReadElement<NonVisualConnectorProperties>();
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("nvCxnSpPr"))
            {
                c.WriteElement(NonVisualDrawingProperties);
                c.WriteElement(NonVisualConnectorProperties);
            }
        }

        #endregion
    }
}